<template>
  <div class="content-div">
    <div class="bread" :class="{ collapse: $store.state.app.isCollapsed === 'true' }">
      <router-link :to="{ path: 'dashboard' }">
        <el-link type="primary">收购信息</el-link>
      </router-link>
      /
      创建
    </div>
    <div class="info-wrapper">
      <p class="info-title clearfix">
        收购信息
      </p>
      <div class="info-content">
        <div class="info-box">
          <p class="sub-title">食品信息</p>
          <el-form class="mt10" :model="basicInfo" label-position="right" label-width="100px">
            <el-form-item label="食品编号:">
              <el-input size="small"></el-input>
            </el-form-item>
            <el-form-item label="收购日期:">
              <el-input size="small"></el-input>
            </el-form-item>
            <el-form-item label="食品描述:">
              <el-input style="width: 60%" type="textarea" :rows="3"></el-input>
            </el-form-item>
            <el-form-item label="图片上传:">
              <el-upload
                  action="https://jsonplaceholder.typicode.com/posts/"
                  list-type="picture-card"
                  :on-preview="handlePictureCardPreview"
                  :on-remove="handleRemove">
                  <i class="el-icon-plus"></i>
                </el-upload>
                <el-dialog :visible.sync="dialogVisible">
                  <img width="100%" :src="dialogImageUrl" alt="">
                </el-dialog>
            </el-form-item>
          </el-form>
        </div>
        <div class="info-box mt20">
          <p class="sub-title">物流信息</p>
          <el-form class="mt10" :model="basicInfo" label-position="right" label-width="100px">
            <el-form-item label="物流编号:">
              <el-input size="small"></el-input>
            </el-form-item>
            <el-form-item label="图片上传:">
              <el-upload
                  action="https://jsonplaceholder.typicode.com/posts/"
                  list-type="picture-card"
                  :on-preview="handlePictureCardPreview2"
                  :on-remove="handleRemove">
                  <i class="el-icon-plus"></i>
                </el-upload>
                <el-dialog :visible.sync="dialogVisible2">
                  <img width="100%" :src="dialogImageUrl2" alt="">
                </el-dialog>
            </el-form-item>
          </el-form>
        </div>
        <div class="info-box mt20">
          <p class="sub-title">存放信息</p>
          <el-form class="mt10" :model="basicInfo" label-position="right" label-width="100px">
            <el-form-item label="信息描述:">
              <el-input style="width: 60%" type="textarea" :rows="3"></el-input>
            </el-form-item>
            <el-form-item label="图片上传:">
              <el-upload
                  action="https://jsonplaceholder.typicode.com/posts/"
                  list-type="picture-card"
                  :on-preview="handlePictureCardPreview3"
                  :on-remove="handleRemove">
                  <i class="el-icon-plus"></i>
                </el-upload>
                <el-dialog :visible.sync="dialogVisible3">
                  <img width="100%" :src="dialogImageUrl3" alt="">
                </el-dialog>
            </el-form-item>
          </el-form>
        </div>
        <div class="info-box mt20">
          <p class="sub-title">其他信息</p>
          <el-form class="mt10" :model="basicInfo" label-position="right" label-width="100px">
            <el-form-item label="信息描述:">
              <el-input style="width: 60%" type="textarea" :rows="3"></el-input>
            </el-form-item>
            <el-form-item label="图片上传:">
              <el-upload
                  action="https://jsonplaceholder.typicode.com/posts/"
                  list-type="picture-card"
                  :on-preview="handlePictureCardPreview4"
                  :on-remove="handleRemove">
                  <i class="el-icon-plus"></i>
                </el-upload>
                <el-dialog :visible.sync="dialogVisible4">
                  <img width="100%" :src="dialogImageUrl4" alt="">
                </el-dialog>
            </el-form-item>
          </el-form>
        </div>
        <div class="txc mt20">
          <el-button type="primary">提交</el-button>
          <el-button>返回</el-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      basicInfo: {},
      dialogVisible: false,
      dialogVisible2: false,
      dialogVisible3: false,
      dialogVisible4: false,
      dialogImageUrl: '',
      dialogImageUrl2: '',
      dialogImageUrl3: '',
      dialogImageUrl4: ''
    }
  },
  methods: {
    handleRemove (file, fileList) {
    },
    handlePictureCardPreview (file) {
      this.dialogImageUrl = file.url
      this.dialogVisible = true
    },
    handlePictureCardPreview2 (file) {
      this.dialogImageUrl2 = file.url
      this.dialogVisible2 = true
    },
    handlePictureCardPreview3 (file) {
      this.dialogImageUrl3 = file.url
      this.dialogVisible3 = true
    },
    handlePictureCardPreview4 (file) {
      this.dialogImageUrl4 = file.url
      this.dialogVisible4 = true
    }
  }
}
</script>
